#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e4+100;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
char str[maxn];
LL dp[maxn][4];
string get(LL l,LL r){
    string s="";
    for(LL i=l;i<=r;i++) s+=str[i];
    return s;
}
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  cin>>(str+1);
  LL len=strlen(str+1);
  if(len<=6){
    cout<<"0"<<"\n";
  }
  else{
    for(LL i=len;i>5;i--){
        if(i+1==len){
            dp[i][2]=1;
            continue;
        }
        if(i+2==len){
            dp[i][3]=1;
            continue;
        }
        if(i+2<len){
            if(dp[i+2][3]==1) dp[i][2]=1;
            else if(dp[i+2][2]==1&&(str[i]!=str[i+2]||str[i+1]!=str[i+3])){
                dp[i][2]=1;
            }
        }
        if(i+3<len){
            if(dp[i+3][2]==1) dp[i][3]=1;
            else if(dp[i+3][3]==1&&(str[i]!=str[i+3]||str[i+1]!=str[i+4]||str[i+2]!=str[i+5])){
                dp[i][3]=1;
            }
        }
    }
    vector<string>v;
    for(LL i=len;i>5;i--){
        if(dp[i][2]==1) v.push_back(get(i,i+1));
        if(dp[i][3]==1) v.push_back(get(i,i+2));
    }
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
    cout<<v.size()<<"\n";
    for(auto i:v){
        cout<<i<<"\n";
    }
  }
return 0;
}
